package domain;

import java.util.Date;

/*CREATE TABLE Clients (
    ClientID INT AUTO_INCREMENT PRIMARY KEY,
    PasswordC VARCHAR(255) NOT NULL，Username VARCHAR(255) NOT NULL,
    UserLevel  VARCHAR(255) ,
    RegistrationDate DATETIME NOT NULL,
    TotalConsumption DECIMAL(10, 2) DEFAULT 0.00,
    PhoneNumber VARCHAR(20) NOT NULL,
    Email VARCHAR(255) NOT NULL UNIQUE,
    state INT NOT NULL
);*/
   /* ALTER TABLE Clients AUTO_INCREMENT = 20230001;
   ALTER TABLE Clients ADD UNIQUE (Username);
*/

public class Client {
    private Integer ClientID;
    private String PasswordC;
    private String Username;
    private String UserLevel;
    private Date RegistrationDate;
    private Double TotalConsumption;
    private String PhoneNumber;
    private String Email;
    private Integer State;
    public Client() {
    }

    public Client(Integer clientID, String passwordC, String username, String userLevel,
                  Date registrationDate, Double totalConsumption, String phoneNumber,
                  String email, Integer state) {
        ClientID = clientID;
        PasswordC = passwordC;
        Username = username;
        UserLevel = userLevel;
        RegistrationDate = registrationDate;
        TotalConsumption = totalConsumption;
        PhoneNumber = phoneNumber;
        Email = email;
        State = state;
    }

    @Override
    public String toString() {
        return
                String.format(
                        "%10s\t%20s\t%10s\t%20s\t%15s\t%20s\t%20s\t%20s",
                        ClientID, Username, UserLevel, RegistrationDate,
                        TotalConsumption, PhoneNumber, Email, "" // 最后一个空字符串用于格式化一致性
                );
    }

    public Integer getState() {
        return State;
    }

    public void setState(Integer state) {
        State = state;
    }

    public Integer getClientID() {
        return ClientID;
    }

    public void setClientID(Integer clientID) {
        ClientID = clientID;
    }

    public String getPasswordC() {
        return PasswordC;
    }

    public void setPasswordC(String passwordC) {
        PasswordC = passwordC;
    }

    public String getUsername() {
        return Username;
    }

    public void setUsername(String username) {
        Username = username;
    }

    public String getUserLevel() {
        return UserLevel;
    }

    public void setUserLevel(String userLevel) {
        UserLevel = userLevel;
    }

    public Date getRegistrationDate() {
        return RegistrationDate;
    }

    public void setRegistrationDate(Date registrationDate) {
        RegistrationDate = registrationDate;
    }

    public Double getTotalConsumption() {
        return TotalConsumption;
    }

    public void setTotalConsumption(Double totalConsumption) {
        TotalConsumption = totalConsumption;
    }

    public String getPhoneNumber() {
        return PhoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        PhoneNumber = phoneNumber;
    }

    public String getEmail() {
        return Email;
    }

    public void setEmail(String email) {
        Email = email;
    }
}
